function f_segregation_forspectrogramFigure7(countf,f4,F_centers,Combined_dual,L_or_R,rad)

    titlesall = {'A. −60^{o}&+60^{o}, control','B. −60^{o}&+60^{o}, hard mask','C. −60^{o}&+60^{o}, soft mask',...
        'D. +65^{o}&+90^{o}, control', 'E. +65^{o}&+90^{o}, hard mask', 'F. +65^{o}&+90^{o}, soft mask'};
for soft_hard = [0 0.2]
    % PlotF = [8 20 40 80]; % 40 ms
    PlotF = [32 80 160 320]; % 160 ms
    fs = 32.1e3; % this is the one for the 3D3A database
    % rad = 0.3;% official 0.3
   
    x1=Combined_dual(:,1);
    x2=Combined_dual(:,2);
    nfft = round(40e-3*fs)
    % nfft = round(160e-3*fs)
    win = hamming(nfft,'periodic');
    Combined_mono = sum(Combined_dual,2);
    % y_ifft = spectrogram(Combined_mono);
    % % % %      short time fourier transform:
    % [SL,SR,freq_pos, flag01]=mySTFT(x1,x2,fs); % replace it with the MATLAB stft
    [SL,Fmask,Tsig] = stft(x1,fs,'Window',win,'FFTLength',nfft);
   

    SR = stft(x2,fs,'Window',win,'FFTLength',nfft);
    Combined_stft = stft(Combined_mono,fs,'Window',win,'FFTLength',nfft);
    % size(Combined_stft)
    % sdf0
    freqs = (1:(nfft/2))./(nfft/2).*fs/2;
    freqs(PlotF)
    SL = SL(end/2+1:end,:);
    SR = SR(end/2+1:end,:);
    B_mask = ones(size(SL));
    % 'size of bmask'
    % size(B_mask)
    % ser0
    %      normalization:
    % [SL1,SR1]=Normalize(SL,SR);
    fcount = 0;
    [SL1,SR1]=Normalize_Both(SL,SR,L_or_R);
    for ifreql = 1:length(freqs)/2
        freq = freqs(ifreql);
        %     X_P = [real(SR1(ifreql,:))' imag(SR1(ifreql,:))'];
        if L_or_R ==2 % old
            X_P = [real(SR1(ifreql,:))' imag(SR1(ifreql,:))'];
        else
            X_P = [real(SL1(ifreql,:))' imag(SL1(ifreql,:))'];
        end
        for i_time=1:length(X_P)
            % B_mask(ifreql,i_time)=1;
            dist = sqrt((X_P(i_time,1)-F_centers(ifreql,1)).^2 + (X_P(i_time,2)-F_centers(ifreql,2)).^2);
            if dist < rad
                B_mask(ifreql,i_time)=soft_hard;
            end
        end
        
    end
    full_mask = [flipud(B_mask); B_mask];

   
    applied = log10(abs(Combined_stft.*full_mask));
    figure(f4)
    if soft_hard==0
        countf=countf+1;
        subplot(2,3,countf)
        contourf(Tsig,Fmask./1000,log10(abs(Combined_stft)),'edgecolor','none');
        ylim([0 5]);
        xlabel('Time (s)');ylabel('Frequency (kHz)');colorbar
        caxis([-5 2.5])
        title(titlesall{countf});
        colormap('jet')
    end

    countf=countf+1;
    subplot(2,3,countf)
    contourf(Tsig,Fmask./1000,applied,'edgecolor','none');
    ylim([0 5]);
    xlabel('Time (s)');ylabel('Frequency (kHz)');colorbar
    caxis([-5 2.5])
    colormap('jet')
    title(titlesall{countf});
    % out.reconstructed = real(istft(applied,fs,'Window',win,'FFTLength',nfft));
    % out.freqs = freqs;
    %
    % if ifplot==1
    %     out.f1 = f1;
    % end
end